package com.changfen.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @author changfeng.chen@things-matrix.com
 * @date 2022/9/21 17:45
 **/
@Data
@Entity
@Table(name = "order_tbl")
@DynamicUpdate
@DynamicInsert
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Order {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @Column(name = "user_id")
    private String userId;

    @Column(name = "commodity_code")
    private String commodityCode;

    @Column(name = "count")
    private Long count;

    @Column(name = "money")
    private Long money;

    @Builder.Default
    @Column(name = "status",columnDefinition = "状态：0.初始化 1.成功 2.失败")
    private Integer status = 0;
}
